<?php


if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

global $prefix, $db;

$limit=4; //Blokta Kaç duyuru yayınlansın.
$metinlimit=100; //Duyuru metni uzunluğu kaç karakter olsun.
$content .="<center><table border=0 cellpadding=1 width=\"100%\"><tr>";  
$result = $db->sql_query("SELECT baslik, metin FROM ".$prefix."_duyuru ORDER BY date DESC LIMIT 0,$limit");
while ($row = $db->sql_fetchrow($result)) {
    $baslik = stripslashes($row['baslik']);
    $metin =  stripslashes($row['metin']);
    if(strlen($metin)>$metinlimit) {
    $metin = substr($metin,0, $metinlimit)."...";
    }
    $content .= "<td valign=\"top\" align=left width=50%><strong><big>&middot;</big></strong>&nbsp;<b>$baslik:</b> $metin<br>";
        if ($count<1) {
            $content .="</td><td>&nbsp;&nbsp;</td>";
            $dum = 1;
        }
        $count++;
        if ($count==2) {
            $content .="</td></tr><tr>";
            $count = 0;
            $dum = 0;
        }
    }
    if ($dum == 1) {
        $content .="</td></tr></table>";
    } elseif ($dum == 0) {
        $content .="<td></td></tr></table>";
    }
$content .="<hr noshade size=1><center><a href=\"modules.php?name=Duyurular\">Bütün Duyurular</a></center>";

?>
